Repository navigation
fix(ui): give the full player's keys to the PodNotes view's own scope - #469
Merged
Merged
Conversation
The full player pushed a key scope above Obsidian's workspace scope, so while it was open a note never got Enter or Escape, as in its find bar. The player now registers Escape and Space on the PodNotes view's own scope. Obsidian hands a view's scope the keys typed while that view's leaf is active, which focus or a press in the view makes it. A menu or modal over the player still takes Escape first, and a queue drag still cancels on Escape. size: 98,781 gzip (-146 vs master 35461cd 98,927)
With a note open in two panes, Undo checked only the first editor it found. It now leaves the note unless every open editor of it holds the text as the capture left it. size: 98,798 gzip (-129 vs master 35461cd 98,927)
Tests now pin that the view's own scope is the one its components register on, drop the scaffolding for the removed window-focus path, set the active leaf through one helper, and press hotkeys through one e2e helper. Undo's editor check gets a typed list and a test for two matching editors.
Deploying podnotes with
|
| Latest commit: |
852f37e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e7ad3a6d.podnotes.pages.dev |
| Branch Preview URL: | https://fix-player-scope-keys.podnotes.pages.dev |
…across two panes The note-key tests used a find bar, whose scope consumes Escape, so player keys registered on app.scope passed both suites. A plain note's editor and a new tab have no use for Escape or Space: the unit cases and a trusted-input journey now check that both leave the full player open and paused. J-TS-20 presses Undo in the same moment a second pane of the note changes, which the every-editor check refuses.
Obsidian's menu pushes its key scope in a timer after it shows, and CDP input runs before that timer. An Escape sent as soon as the menu showed could reach the view under it, which closed the volume slider and left the menu open.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
While the full player was open, a note never got Enter or Escape. In its find bar, Enter didn't move to the next match and Escape didn't close the bar. The player pushed its own key scope onto Obsidian's keymap stack, above the workspace scope that hands keys to the active note. This came in with the v3 shell (#434) and is not released yet.
Fixes #467
What changed
ItemView.scope). Obsidian hands that scope the keys typed while the view's leaf is active, and focus or a press in the view makes it active. A note, its find bar and every other view get their own keys again.Scope
Blast Radius
Every user with the full player open gets their note keys back. The player's own keys now need the PodNotes view to be the active leaf, which any click or focus in the view gives it. A player opened from a link or command while the user types in a note leaves the keys with the note, as #467 asks. In a popout window, Obsidian makes the view's leaf active a moment after the window gets OS focus (it waits about 100 ms), so a key typed in that first moment still goes to the leaf that was active before. The verifier saw this on Linux; macOS and Windows are not checked.
Verification
app.scope, the note case fails on Escape, the new-tab case fails on Space, and the journey fails. All pass here.Docs at release
Note
Move full-player keyboard handling to PodcastView's own scope
The full player no longer pushes its own Obsidian
Scopeonto each window's key stack. Instead,MainView.mountPodcastViewin index.ts creates a child scope of the app scope, stores it on the view, and passes it through the new requiredscopefield onShellServicesin context.ts.ShellServicesgained a requiredscopeproperty, so any code constructing these services without a scope will fail; capture Undo previously reverted via the first matching editor and now reverts only when every open editor matches the capture snapshot.Macroscope summarized 852f37e.